/**
 *  Java Api For Ecco Generated Applications 
 *  
 *  Copyright (C) 2000  by PDTec GmbH 
 *
 * @author  Michael Weirich
 */

package pdtec.ecco.meta;

/**
 * The class Entity serves as a proxy for the equivalent Express ENTITY.
 * Note: Entity is a subclass of class Type.
 * @see  pdtec.ecco.meta.Type
 */
public class Entity extends Type {

    /** The constructor requires a valid application and the type id */
    protected Entity ( int appId,long typeId) {
     super(appId,typeId);
     } // constructor

    /** Returns list of explicit attributes defined within the entity.
     * @return array of explicit attributes
     * @exception EccoException in case an error occurs
     */
    public native synchronized Attribute[] getExplicit() throws EccoException;
    
    /** Returns list of derived attributes defined within the entity.
     * @return array of derived attributes
     * @exception EccoException in case an error occurs
     */
    public native synchronized Attribute[] getDerived() throws EccoException;
    
    /** Returns list of inverse attributes defined within the entity.
     * @return array of inverse attributes
     * @exception EccoException in case an error occurs
     */
    public native synchronized Attribute[] getInverse() throws EccoException;
    
    /** Returns list of super types of the entity.
     * @return array of entities
     * @exception EccoException in case an error occurs
     */
    public native synchronized Type[] getSuperTypes() throws EccoException;
    
    /** Returns list of super types of the entity.
     * @return array of entities
     * @exception EccoException in case an error occurs
     */
    public native synchronized Type[] getSubTypes() throws EccoException;
    
    //public native synchronized Attribute getAttributeBN(String name) throw EccoException;

    /** Returns true if the entity is abstract. 
     * @exception EccoException in case an error occurs
     */
    public native synchronized boolean isAbstract() throws EccoException;

	/** Returns partial types of the Entity.
     * @exception EccoException in case an error occurs
     */
	public native synchronized Type[] getPartialTypes() throws EccoException;

    /** Finalizes the object and calls delete. */
    protected void finalize() {
	try {
	    if ( appId != -1 )
		delete();
	} catch ( EccoException e) {
	    System.out.println(e.toString());
	} // try
    } // finalize
   
} // class Entity 
